/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.dorian.atomicuml.orm;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author cedric.creusot
 */
@Entity
@Table(name = "DIAGRAMMS", catalog = "dorian", schema = "")
@NamedQueries({
    @NamedQuery(name = "Diagramms.findAll", query = "SELECT d FROM Diagramms d"),
    @NamedQuery(name = "Diagramms.findById", query = "SELECT d FROM Diagramms d WHERE d.id = :id"),
    @NamedQuery(name = "Diagramms.findByName", query = "SELECT d FROM Diagramms d WHERE d.name = :name"),
    @NamedQuery(name = "Diagramms.findByDescription", query = "SELECT d FROM Diagramms d WHERE d.description = :description"),
    @NamedQuery(name = "Diagramms.findByEditorId", query = "SELECT d FROM Diagramms d WHERE d.editorId = :editorId")})
public class Diagramms implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @NotNull
    @Column(name = "ID")
    private Integer id;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 128)
    @Column(name = "NAME")
    private String name;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 128)
    @Column(name = "DESCRIPTION")
    private String description;
    @Lob
    @Size(max = 65535)
    @Column(name = "DATA")
    private String data;
    @Basic(optional = false)
    @NotNull
    @Column(name = "WIDTH")
    private Integer width;
    @Basic(optional = false)
    @NotNull
    @Column(name = "HEIGHT")
    private Integer height;
    @Basic(optional = false)
    @NotNull
    @Column(name = "EDITOR_ID")
    private Integer editorId;


    
    public Diagramms() {
    }

    public Diagramms(Integer id) {
        this.id = id;
    }

    public Diagramms(Integer id, String name, String description, Integer editorId) {
        this.id = id;
        this.name = name;
        this.description = description;
        this.editorId = editorId;
        this.width = 606;
        this.height = 400;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getData() {
        return data;
    }

    public void setData(String data) {
        this.data = data;
    }

    public Integer getEditorId() {
        return editorId;
    }

    public void setEditorId(Integer ownerId) {
        this.editorId = ownerId;
    }

    public Integer getHeight() {
        return height;
    }

    public void setHeight(Integer height) {
        this.height = height;
    }

    public Integer getWidth() {
        return width;
    }

    public void setWidth(Integer width) {
        this.width = width;
    }
    
    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Diagramms)) {
            return false;
        }
        Diagramms other = (Diagramms) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.dorian.atomicuml.orm.Diagramms[ id=" + id + " ]";
    }
    
}
